<template>
    <div>
        {{testfromZong}}
        {{testfromA}}
        <br>
        <button @click="updateZong('zong')">update testfromZong</button>
        <button @click="updateA('a')">update testfromA</button>
    </div>
</template>

<script>
    import {getBaseCategoryList,getBanners,getFloors} from "http";
    import {mapState,mapActions} from "vuex"
    export default {
        name: "test",
        computed:{
            //mapState([总仓库中的数据名称])
            //mapState({组件上使用的名称:总仓库中的数据名称})
            //mapState({组件上使用的名称:(state)=>{ //state:总仓库的state }})
            // ...mapState(["test"])
            // ...mapState({testfromZong:"test"})
            ...mapState({
                 testfromZong:(state)=>{return state.test},
                 testfromA:(state)=>{return state.a.test}
            })
        },
        methods:{
            ...mapActions(["updateZong","updateA"])
        },
        async created(){
            const body = await getBaseCategoryList()
            const body2 = await getBanners()
            const body3 = await getFloors()
            console.log(body2,body3);
        }
    }
</script>

<style scoped>

</style>